<script language="javascript">
$(function(){
	$('form').form({ 
		success:function(data){
			var data = runJson(data);
			if(data.status == 0){
				alertText(data.info, 'error');
			}else{
				alertText(data.info, 'success', 'back');
			}
		}   
	}); 
});
</script>
<div class="box">
	<div class="easyui-panel" title="{$page_title}">
    <form action="<eq name='ACTION_NAME' value='edit'>{:U('Set/update')}<else />{:U('Set/insert')}</eq>&ajax=true" method="post">
    	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table">
          <tr>
            <td class="label">变量名：</td>
            <td>
            <input type="text" value="{$vo.var}" id="var" name="var" style="width:200px;" class="easyui-validatebox input" required="true" validType="length[3,20]" />
            </td>
          </tr>
          <tr>
            <td class="label">显示名称：</td>
            <td>
            <input type="text" value="{$vo.name}" id="name" name="name" style="width:200px;" class="easyui-validatebox input" required="true" validType="length[3,15]" />
            </td>
          </tr>
          <tr>
            <td class="label">默认值：</td>
            <td>
            <input type="text" value="{$vo.value}" id="value" name="value" style="width:200px;" class="easyui-validatebox input" required="true" validType="length[1,15]" />
            </td>
          </tr>
          <tr>
            <td class="label">可选值列表：</td>
            <td>
            <input type="text" value="{$vo.value_list}" id="value_list" name="value_list" style="width:300px;" class="input" />
            <p class="notice">多个可选值用“,”隔开，值与显示名称之间用“|”隔开。</p>
            </td>
          </tr>
          <tr>
            <td class="label">排序：</td>
            <td>
            <input type="text" value="{$vo.sort}" id="sort" name="sort" style="width:100px;" class="input" />
            </td>
          </tr>
          <tr>
            <td class="label">所属组：</td>
            <td>
            <select name="parent_id">
            <volist name="group" id="gp">
            <option value="{$key}">{$gp}</option>
            </volist>
            </select>
            </td>
          </tr>
          <tr>
            <td class="label">类型：</td>
            <td>
            <select name="type">
            <volist name="type" id="tp">
            <option value="{$key}">{$tp}</option>
            </volist>
            </select>
            </td>
          </tr>
          <tr>
            <td class="label">备注：</td>
            <td>
            <textarea name="desc" style="width:350px; height:100px;" class="input"></textarea>
            </td>
          </tr>
          <tr>
            <td class="label">&nbsp;</td>
            <td>
            <eq name='ACTION_NAME' value='edit'><input type="hidden" name="id" value="{$vo.id}" /></eq>
            <input align="absmiddle" class="button" type="submit" value="保存" id="submits" onclick="return $('form').form('validate')" />
            </td>
          </tr>
        </table>
    </form>
    </div>
</div>